Cleanup Eshell to rely less on dynamic scoping.
authorStefan Monnier <monnier@iro.umontreal.ca>
Thu, 12 Sep 2013 05:20:07 +0000 (01:20 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Thu, 12 Sep 2013 05:20:07 +0000 (01:20 -0400)
commitbd88512ecd8bab9db5e804fc4b7bb8ad8b07907e
tree0306ee2d209a74f0bde80f303276b293562e7097
parent094254160181c883071770c947b0b4b3f727466a
Cleanup Eshell to rely less on dynamic scoping.
* lisp/eshell/esh-opt.el (eshell-eval-using-options): Don't bind usage-msg,
last-value, and ext-command here.  Bind `args' closer to `body'.
(temp-args, last-value, usage-msg, ext-command, args): Don't defvar.
(eshell--args): Declare new dynamic var.
(eshell-do-opt): Add argument `args'.  Bind our own usage-msg,
last-value, and ext-command.  Pass `args' to `body'.
(eshell-process-args): Bind eshell--args.
(eshell-set-option): Use eshell--args.
* lisp/eshell/eshell.el (eshell): Use derived-mode-p.
* lisp/eshell/esh-var.el (eshell-parse-variable): Use backquote.
(eshell-parse-variable-ref): Remove unused vars `end' and `err'.
(eshell-glob-function): Declare.
* lisp/eshell/esh-util.el: Require cl-lib.
(eshell-read-hosts-file): Avoid add-to-list.
* lisp/eshell/esh-cmd.el (eshell-parse-lisp-argument): Remove unused var
`err'.
* lisp/eshell/em-unix.el (compilation-scroll-output, locate-history-list):
Declare.
(eshell/diff): Remove unused var `err'.
* lisp/eshell/em-rebind.el (eshell-delete-backward-char): Remove unused arg
`killflag'.
* lisp/eshell/em-pred.el (eshell-parse-modifiers): Remove unused var `err'.
* lisp/eshell/em-ls.el (eshell-ls-highlight-alist): Move defvars before
first use.
* lisp/eshell/em-glob.el (eshell-glob-matches, message-shown):
Move declaration before first use.
* lisp/eshell/em-alias.el (eshell-maybe-replace-by-alias): Use backquotes.
* autorevert.el (auto-revert-notify-handler): Use `cl-dolist' since we
rely on cl-return.
13 files changed:
lisp/ChangeLog
lisp/eshell/em-alias.el
lisp/eshell/em-glob.el
lisp/eshell/em-ls.el
lisp/eshell/em-pred.el
lisp/eshell/em-rebind.el
lisp/eshell/em-unix.el
lisp/eshell/esh-arg.el
lisp/eshell/esh-cmd.el
lisp/eshell/esh-opt.el
lisp/eshell/esh-util.el
lisp/eshell/esh-var.el
lisp/eshell/eshell.el